package com.guoguo.bean;

import java.io.Serializable;

//import javax.faces.bean.ManagedBean;
//import javax.faces.bean.SessionScoped;

import javax.inject.Named;
import javax.enterprise.context.SessionScoped;

//@ManagedBean(name = "user")
@Named("user")
@SessionScoped
public class UserBean implements Serializable {

	private static final long serialVersionUID = -7858335225156624734L;
	
	private String name;
	
	private String password;
		
	public String getGreeting() {
//		javax.faces.webapp.FacesServlet df;
		if (name == null || name.length() == 0 ) {
			return "name is null!";
		}else if ("".equals(name.trim())) {
			return "illegal name!";
		} else {
			return "Welcome3," + name + "!"; 
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String newValue) {
		name = newValue;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String newValue) {
		password = newValue;
	}
}
